<extend name="Home@Base/common" xmlns="http://www.w3.org/1999/html"/>
<block name="body">
    <div class="span9 page_message">
        <section id="contents"> <include file="Home@Addons/_nav" />
            <div class="tab-content">
                <form class="form-horizontal form-center" method="post" action="{$post_url}" id="form" autocomplete="off">
                <div style="margin-left: 10%; margin-bottom: 8px">
                    <!--<button style="width:120px; margin-right: 80px" value='返回' name="button"><font color="#4097ce"> <<返回到列表页</font></button>-->
                    <if condition="$applyInfo.is_draft eq 1">
                        <button style="width:60px; margin-right: 150px" value='刪除' name="button" onclick="return del_confirm()">删&nbsp&nbsp&nbsp除</button>
                    <else />
                        <button style="width:60px; margin-right: 150px" value='取消' name="button">取&nbsp&nbsp&nbsp消</button>
                    </if>
                    <button style="width:60px; margin-right: 150px" value='保存' name="button">保&nbsp&nbsp&nbsp存</button>
                    <button style="width:60px;" value='提交' name="button">提&nbsp&nbsp&nbsp交</button>
                </div>
                <notempty name="applyInfo.failback">
                    <div class="itemdiv"><label class="item-label" style="width: 200px;float: left">
                        <a href="{:U(loglists, array('application_id'=>$applyInfo['id'],'method'=>'add'))}"><font color="red"> <被驳回,点击查看详情></font></a>
                    </label></div>
                </notempty>
                <hr>
                <table border=0>
                    <tr>
                        <td><label class="item-label">申请单号:</label></td>
                        <td colspan="4"> <span class="check-tips">{$applyInfo.apply_no}</span></td>
                        <td><label class="item-label">创建时间:</label></td>
                        <td colspan="4"> <span class="check-tips">{$applyInfo.create_time}</span></td>
                        <td><label class="item-label">报销类型:</label></td>
                        <td><span class="check-tips">{$applyInfo.type}</span></td>
                    </tr>
                    <tr>
                        <td><label class="item-label">申请人:</label></td>
                        <td colspan="4">{$applyInfo.applyer}</td>
                        <td><label class="item-label">申请人部门:</label></td>
                        <td colspan="4">{$applyInfo.dept}</td>
                        <td><label class="item-label">职务:</label></td>
                        <td><span class="check-tips">{$applyInfo.duty}</span></td>
                    </tr>
                    <!--<if condition="$applyInfo.subtype eq 0">-->
                        <!--<tr height="10">-->
                            <!--<td colspan="2"><label class="item-label">经费来源 </label></td>-->
                            <!--<td colspan="4">-->
                                <!--<div>-->
                                    <!--<input style="border: none;overflow: hidden;height: 100%;width: 100%" name="costCenter"  type="text"   placeholder="请输入经费来源" value="{$vo.costCenter}">-->
                                <!--</div>-->
                            <!--</td>-->
                            <!--<td colspan="2"><label class="item-label">专项名称 </label></td>-->
                            <!--<td colspan="4">-->
                                <!--<div>-->
                                    <!--<input style="border: none;overflow: hidden;height: 100%;width: 100%" name="project"  type="text"   placeholder="请输入专项名称" value="{$vo.project}">-->
                                <!--</div>-->
                            <!--</td>-->
                        <!--</tr>-->
                    <!--</if>-->
                </table>
                <hr>

                <if condition="$applyInfo.subtype eq 0">
                    <div id="trip">
                    <table>
                        <td style="border:0px" colspan="2"><label class="item-label">经费来源 </label></td>
                        <td style="border:0px" colspan="2">
                            <div class="inputsize" style="margin-top: 3px">
                                <input name="costCenter"  type="text"   placeholder="请输入经费来源" value="{$applyInfo.costCenter}">
                            </div>
                        </td>
                        <td style="border:0px" colspan="2"><label class="item-label">专项名称 </label></td>
                        <td style="border:0px" colspan="2">
                            <div class="inputsize" style="margin-top: 3px">
                                <input name="project"  type="text"   placeholder="请输入专项名称" value="{$applyInfo.project}">
                            </div>
                        </td>
                    </table>
                    <hr>
                    <volist name="applyInfo.itinerarys" id="vo">
                        <div><label class="item-label">行程 {$vo.id}:</label></div>
                        <table>
                            <tr style="border:0px">
                                <td style="border:0px" colspan="2"><label class="item-label">起始日期</label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input type="datetime" name="start_date{$vo.id}"  class="date"  placeholder="请选择日期" value="{$vo.start_date}"/>
                                    </div>
                                </td>
                                <td style="border:0px" colspan="2"><label class="item-label">结束日期</label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input type="datetime" name="end_date{$vo.id}" class="date"  placeholder="请选择日期" value="{$vo.end_date}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr style="border:0px">
                                <td style="border:0px" colspan="2"><label class="item-label">出发地 </label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input name="start_addr{$vo.id}" id="citySelect_s{$vo.id}"  type="text"  class="city_input" placeholder="请选择地址" value="{$vo.start_addr}">
                                    </div>
                                </td>
                                <td style="border:0px" colspan="2"><label class="item-label">目的地 </label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input name="end_addr{$vo.id}" id="citySelect_e{$vo.id}"  type="text"  class="city_input" placeholder="请选择地址" value="{$vo.end_addr}">
                                    </div>
                                </td>
                            </tr>
                            <tr style="border:0px">
                                <td style="border:0px" colspan="2"><label class="item-label">人数 </label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input name="people_num{$vo.id}"  type="text"   placeholder="请输入人数" value="{$vo.people_num}">
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:100;width:100%;height:100%;display:none;">
                            <div id="innerdiv" style="position:absolute;">
                                <img id="bigimg" style="border:5px solid #fff;" src="" />
                            </div>
                        </div>
                        <notempty name="vo.items">
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">报销条目明细:</label></div>
                        </notempty>
                        <volist name="vo.items" id="item">
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">条目类别:</label><label class="item-label">{$item.type}</label></div>
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">金额数:</label><label class="item-label">{$item.total} 元</label></div>
                            <notempty name="item.standard">
                                <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">日标准:</label><label class="item-label">{$item.standard} </label></div>
                            </notempty>
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">发票张数:</label><label class="item-label">{$item.invoiceCount} 张</label></div>
                            <notempty name="vo.description">
                                <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">备  注:</label><label class="item-label">{$item.description}</label></div>
                            </notempty>
                            <div class="item_image_box">
                                <volist name="item.pictures" id="pic">
                                    <img class="item_image" src={$pic} >
                                </volist>
                            </div>
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">[
                                <a href="{:addons_url('OaSystem://OaApplyItem/edit', array('application_id'=>$item['application_id'],'item_id'=>$item['id']))}"> 编 辑,</a>
                                <a href="javascript:if(confirm('确实要删除吗?'))location='{:addons_url('OaSystem://OaApplyItem/del', array('application_id'=>$item['application_id'],'item_id'=>$item['id']))}'"> 删 除</a> ]
                            </label></div>
                            <br/>
                        </volist>
                        <div id="addItem" style="margin-top: 3px">
                            <label class="item-label" style="margin-right: 40px">选择添加明细的类型</label>
                            <select id="selectI" name="itemType{$vo.id}" title="" >
                                <volist name="applyInfo.itemTypes" id="type">
                                    <option value="{$type.index}"> {$type.name}</option>
                                </volist>
                            </select>
                            <button class="button" style="margin-left: 100px;text-align: center" value="{$vo.id}" name="button_add">+添加一条明细</button>
                        </div>
                        <hr>
                    </volist>
                        <notempty name="applyInfo.items">
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">总金额数:</label><label class="item-label">{$applyInfo.total_money} 元</label></div>
                        </notempty>
                        <br/>
                        <button class="button1" style="margin-left: 20px;text-align: center" value='新增行程' name="button">+添加新的行程</button>
                        <button class="button1" style="margin-left: 20px;text-align: center" value='删除行程' name="button" onclick="return del_confirm()">-删除最后行程</button>
                    </div>
                </if>
                <if condition="$applyInfo.subtype eq 1">
                    <div id="meeting">
                    <div><label class="item-label">申请详细内容:</label></div>
                    <table>
                        <tr style="border:0px">
                            <td style="border:0px" colspan="2"><label class="item-label">起始日期</label></td>
                            <td style="border:0px" colspan="2">
                                <div class="inputsize" style="margin-top: 3px">
                                    <input type="datetime" name="start_date" class="date"  placeholder="请选择日期" value="{$applyInfo.details.start_date}" disableautocomplete />
                                </div>
                            </td>
                            <td style="border:0px" colspan="2"><label class="item-label">结束日期</label></td>
                            <td style="border:0px" colspan="2">
                                <div class="inputsize" style="margin-top: 3px">
                                    <input type="datetime" name="end_date" class="date"  placeholder="请选择日期" value="{$applyInfo.details.end_date}" disableautocomplete />
                                </div>
                            </td>
                        </tr>
                        <tr style="border:0px">
                            <td style="border:0px" colspan="2"><label class="item-label">会议培训</label></td>
                            <td style="border:0px" colspan="2">
                                <div class="inputsize" style="margin-top: 3px">
                                    <input name="end_addr" id="citySelect_m"  type="text"  class="city_input" placeholder="请选择地址" value="{$applyInfo.details.end_addr}">
                                </div>
                            </td>
                            <td style="border:0px" colspan="2"><label class="item-label">培训类别</label></td>
                            <td style="border:0px;float: left;padding-top: 1%px" colspan="2">
                                <select name="traintype" style="width: 177px;height: 85%;padding-top: 0px">
                                    <volist name="applyInfo.details.traintype" id="vo">
                                        <option {$vo.selected} value="{$vo.id}">{$vo.name}</option>
                                    </volist>
                                </select>
                            </td>
                        </tr>
                        <tr style="border:0px">
                            <td style="border:0px" colspan="2"><label class="item-label">与会人数</label></td>
                            <td style="border:0px" colspan="2">
                                <div class="inputsize" style="margin-top: 3px">
                                    <input type="number" name="attendance"  placeholder="请填人数" value="{$applyInfo.details.attendance}"/>
                                </div>
                            </td>
                            <td style="border:0px" colspan="2"><label class="item-label">专项名称 </label></td>
                            <td style="border:0px" colspan="2">
                                <div class="inputsize" style="margin-top: 3px">
                                    <input name="project"  type="text"   placeholder="请输入专项名称" value="{$applyInfo.project}">
                                </div>
                            </td>
                        </tr>
                    </table>
                    </div>
                </if>
                <if condition="$applyInfo.subtype eq 2">
                    <div id="trip">
                        <div><label class="item-label">申请详细内容:</label></div>
                        <table>
                            <tr style="border:0px">
                                <td style="border:0px" colspan="2"><label class="item-label">起始日期</label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input type="datetime" name="start_date"  class="date"  placeholder="请选择日期" value="{$applyInfo.details.start_date}"/>
                                    </div>
                                </td>
                                <td style="border:0px" colspan="2"><label class="item-label">结束日期</label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input type="datetime" name="end_date" class="date"  placeholder="请选择日期" value="{$applyInfo.details.end_date}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr style="border:0px">
                                <td style="border:0px" colspan="2"><label class="item-label">出发地 </label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input name="start_addr" id="citySelect_s"  type="text"  class="city_input" placeholder="请选择地址" value="{$applyInfo.details.start_addr}">
                                    </div>
                                </td>
                                <td style="border:0px" colspan="2"><label class="item-label">目的地 </label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input name="end_addr" id="citySelect_e"  type="text"  class="city_input" placeholder="请选择地址" value="{$applyInfo.details.end_addr}">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td style="border:0px" colspan="2"><label class="item-label">专项名称 </label></td>
                                <td style="border:0px" colspan="2">
                                    <div class="inputsize" style="margin-top: 3px">
                                        <input name="project"  type="text"   placeholder="请输入专项名称" value="{$applyInfo.project}">
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </if>
                <if condition="$applyInfo.subtype neq 0">
                    <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:100;width:100%;height:100%;display:none;">
                        <div id="innerdiv" style="position:absolute;">
                            <img id="bigimg" style="border:5px solid #fff;" src="" />
                        </div>
                    </div>
                    <div id="items">
                        <volist name="applyInfo.items" id="vo">
                            <label class="item-label">报销条目明细:</label>
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">条目类别:</label><label class="item-label">{$vo.type}</label></div>
                            <notempty name="vo.price">
                                <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">单价:</label><label class="item-label">{$vo.price} 元</label></div>
                            </notempty>
                            <notempty name="vo.quantity">
                                <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">数量:</label><label class="item-label">{$vo.quantity}</label></div>
                            </notempty>
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">金额数:</label><label class="item-label">{$vo.total} 元</label></div>
                            <notempty name="vo.standard">
                                <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">日标准:</label><label class="item-label">{$vo.standard} </label></div>
                            </notempty>
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">发票张数:</label><label class="item-label">{$vo.invoiceCount} 张</label></div>
                            <notempty name="vo.description">
                                <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">备  注:</label><label class="item-label">{$vo.description}</label></div>
                            </notempty>
                            <div class="item_image_box">
                                <volist name="vo.pictures" id="pic">
                                    <img class="item_image" src={$pic} >
                                </volist>
                            </div>
                            <notempty name="vo.fileCount">
                                <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">附件数量:</label><label class="item-label">{$vo.fileCount} 个</label></div>
                            </notempty>
                            <notempty name="vo.files">
                                <div class="itemdiv">
                                    <label class="item-label" style="width: 120px;float: left">附件:</label>
                                    <volist name="vo.files" id="f">
                                        <a href="{$f['url']}"><span class="upload_icon_all" ></span>{$f['name']}</a>
                                        <span>&nbsp&nbsp</span>
                                    </volist>
                                </div>
                            </notempty>
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">[
                                <a href="{:addons_url('OaSystem://OaApplyItem/edit', array('application_id'=>$vo['application_id'],'item_id'=>$vo['id']))}"> 编 辑,</a>
                                <a href="javascript:if(confirm('确实要删除吗?'))location='{:addons_url('OaSystem://OaApplyItem/del', array('application_id'=>$vo['application_id'],'item_id'=>$vo['id']))}'"> 删 除</a> ]
                            </label></div>
                            <hr>
                        </volist>
                        <notempty name="applyInfo.items">
                            <div class="itemdiv"><label class="item-label" style="width: 120px;float: left">总金额数:</label><label class="item-label">{$applyInfo.total_money} 元</label></div>
                            <notempty name="applyInfo.meeting_std_total_hint">
                            <div class="itemdiv"><label class="item-label" style="float: left"><font color="red">{$applyInfo.meeting_std_total_hint}</font></label></div>
                            </notempty>
                        </notempty>
                    </div>
                    <hr>
                    <div id="addItem" style="margin-top: 3px">
                        <label class="item-label" style="margin-right: 40px">选择添加明细的类型</label>
                        <select id="selectI" name="itemType" title="" >
                            <volist name="applyInfo.itemTypes" id="vo">
                                <option value="{$vo.index}"> {$vo.name}</option>
                            </volist>
                        </select>
                        <button class="button1" style="margin-left: 100px;text-align: center" value='添加明细' name="button">+添加一条明细</button>
                    </div>
                </if>
                <!--<div>-->
                    <!--<div class="order_status">-->
                        <!--<volist name="applyInfo.process_bar" id="vo">-->
                        <!--<span class="s-step s-step{$vo.step} {$vo.active}"><b><b></b></b>-->
                        <!--<empty name="vo.last_step">-->
                            <!--<p></p >-->
                        <!--</empty>-->
                        <!--<em>{$vo.nodeState}</em>-->
                        <!--<div>{$vo.nodeName}</div>-->
                            <!--<em>哈哈哈</em>-->
                        <!--</span>-->
                        <!--</volist>-->
                    <!--</div>-->
                <!--</div>-->
                <div>
                    <input type="hidden" name="application_id" value="{$applyInfo.id}">
                    <input type="hidden" name="subtype" value="{$applyInfo.subtype}">
                </div>
                </form>
            </div>
        </section>
    </div>
</block>
<block name="style">
    <style type="text/css">
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 0 auto;
            text-align: center;
        }
        table td, table th {
            border: 1px solid #cad9ea;
            color: #666;
            height: 30px;
            text-align: center;
        }
        table thead th {
            background-color: #CCE8EB;
            width: 100px;
        }
        table tr:nth-child(odd) {
            background: #fff;
        }
        table tr:nth-child(even) {
            background: #F5FAFA;
        }
        .inputsize{
            display: flex;
            width: 160px;
            height: 35px;
            font-size: 14px;
            padding: 0,0,0,0;
            text-align: center;
        }
        select#selectI
        {
            width                    : 120px;
            height                   : 30px;
            padding                  : 0;
            vertical-align           : top;
            border                   : 1px solid #94c1e7;
            -moz-border-radius       : 3px;
            -webkit-border-radius    : 3px;
            border-radius            : 3px;
            -webkit-appearance       : none;
            -moz-appearance          : none;
            appearance               : none;
            background               : #ffffff url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll right center transparent;
            font-family              : SimHei;
            font-size                : 14px;
            color                    : RGBA(102,102,102,0.7);
            cursor                   : pointer;
            text-align               : center;
        }
        select#selectPointOfInterest
        {
            width                    : 185pt;
            height                   : 40pt;
            line-height              : 40pt;
            padding-right            : 20pt;
            text-indent              : 4pt;
            text-align               : left;
            vertical-align           : middle;
            border                   : 1px solid #94c1e7;
            -moz-border-radius       : 6px;
            -webkit-border-radius    : 6px;
            border-radius            : 6px;
            -webkit-appearance       : none;
            -moz-appearance          : none;
            appearance               : none;
            font-family              : SimHei;
            font-size                : 14pt;
            font-weight              : 500;
            color                    : RGBA(102,102,102,0.7);
            cursor                   : pointer;
            outline                  : none;
        }
        div#lblSelect{ position: relative; display: inline-block;}

        div#lblSelect::after
        {
            content                 : "\25bc";
            position                : absolute;
            top                     : 0;
            right                   : 0;
            bottom                  : 0;
            width                   : 20pt;
            line-height             : 20pt;
            vertical-align          : middle;
            text-align              : center;
            background              : #94c1e7;
            color                   : #2984ce;
            -moz-border-radius       : 0 3px 3px 0;
            -webkit-border-radius    : 0 3px 3px 0;
            border-radius           : 0 3px 3px 0;
            pointer-events          : none;
        }
        .button1 {
            background-color: #008CBA; /* blue */
            border: none;
            color: white;
            padding: 5px 20px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 14px;
        }
        .itemdiv{
            display: flex;
            width: 100%;
            height: 30px;
            font-size: 14px;
            padding: 0,0,0,0;
            text-align: center;
        }
        .item_image{
            width: 100px;
            height: 100px;
            float: left;
            margin-right: 10px;
            margin-bottom: 10px;
        }
        .item_image_box{
            width: 100%;
            height:auto;
            word-break: break-all;
            word-wrap: break-word;
            overflow: hidden;
        }
        #dialog_pic {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0,0,0,0.65);
            z-index: 100;
            display: none;
            .dialog-body {
                width: 100%;
                max-width: 250px;
                max-height: 300px;
                margin: 0 auto;
                padding: 10px;
                border-radius: 5px;
                background: white;
                overflow: auto;
                margin-top: 283px;
                img {
                    width: 100%;
                }
            }
        }
    </style>
</block>
<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '
        <link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
        ';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    <link href="__STATIC__/cityselect/cityLayout.css" rel="stylesheet">
    <script type="text/javascript" src="__STATIC__/cityselect/cityselect.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}" charset="UTF-8"></script>
    <script type="text/javascript">
        $(function() {
            $('.date').datetimepicker({
                format: 'yyyy-mm-dd',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
            init_city_select($("#citySelect_s"));
            init_city_select($("#citySelect_e"));
            init_city_select($("#citySelect_m"));
            init_city_select($("#citySelect_s1"));
            init_city_select($("#citySelect_e1"));
            init_city_select($("#citySelect_s2"));
            init_city_select($("#citySelect_e2"));
            init_city_select($("#citySelect_s3"));
            init_city_select($("#citySelect_e3"));
            init_city_select($("#citySelect_s4"));
            init_city_select($("#citySelect_e4"));
            init_city_select($("#citySelect_s5"));
            init_city_select($("#citySelect_e5"));
            showTab();
            $("img.item_image").click(function(){
                var _this = $(this); // 将当前的pimg元素作为_this传入函数
                imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
            });
            processStepBar();
        });

        function imgShow(outerdiv, innerdiv, bigimg, _this){
            var src = _this.attr("src");   //获取当前点击的pimg元素中的src属性
            $(bigimg).attr("src", src);    //设置#bigimg元素的src属性

            /*获取当前点击图片的真实大小，并显示弹出层及大图*/
            $("<img/>").attr("src", src).load(function(){
                var windowW = $(window).width();  //获取当前窗口宽度
                var windowH = $(window).height();  //获取当前窗口高度
                var realWidth = this.width;  //获取图片真实宽度
                var realHeight = this.height;  //获取图片真实高度
                var imgWidth, imgHeight;
                var scale = 0.8;  //缩放尺寸，当图片真实宽度和高度大于窗口宽度和高度时进行缩放

                if(realHeight>windowH*scale) {  //判断图片高度
                    imgHeight = windowH*scale;  //如大于窗口高度，图片高度进行缩放
                    imgWidth = imgHeight/realHeight*realWidth;  //等比例缩放宽度
                    if(imgWidth>windowW*scale) {  //如宽度扔大于窗口宽度
                        imgWidth = windowW*scale;  //再对宽度进行缩放
                    }
                } else if(realWidth>windowW*scale) {  //如图片高度合适，判断图片宽度
                    imgWidth = windowW*scale;   //如大于窗口宽度，图片宽度进行缩放
                    imgHeight = imgWidth/realWidth*realHeight;  //等比例缩放高度
                } else {    //如果图片真实高度和宽度都符合要求，高宽不变
                    imgWidth = realWidth;
                    imgHeight = realHeight;
                }
                $(bigimg).css("width",imgWidth);    //以最终的宽度对图片缩放

                var w = (windowW-imgWidth)/2;   //计算图片与窗口左边距
                var h = (windowH-imgHeight)/2;  //计算图片与窗口上边距
                $(innerdiv).css({"top":h, "left":w});   //设置#innerdiv的top和left属性
                $(outerdiv).fadeIn("fast"); //淡入显示#outerdiv及.pimg
            });

            $(outerdiv).click(function(){   //再次点击淡出消失弹出层
                $(this).fadeOut("fast");
            });
        }

        function processStepBar() {
            if($(".s-step0").hasClass("active")){
                $(".s-step0>b>b,.s-step0>div").addClass("active");
                $(".s-step1>em,.s-step2>em,.s-step3>em,.s-step4>em").hide();
            }
            else if($(".s-step1").hasClass("active")){
                $(".s-step1>b>b,.s-step1>div,.s-step0>b>b,.s-step0>p,.s-step0>div").addClass("active");
                $(".s-step2>em,.s-step3>em,.s-step4>em").hide();
            }
            else if($(".s-step2").hasClass("active")){
                $(".s-step2>b>b,.s-step2>div,.s-step1>p,.s-step1>b>b,.s-step1>div,.s-step0>b>b,.s-step0>p,.s-step0>div").addClass("active");
                $(".s-step3>em,.s-step4>em").hide();
            }
            else if($(".s-step3").hasClass("active")){
                $(".s-step3>b>b,.s-step3>div,.s-step2>p,.s-step2>b>b,.s-step2>div,.s-step1>p,.s-step1>b>b,.s-step1>div,.s-step0>b>b,.s-step0>p,.s-step0>div").addClass("active");
                $(".s-step4>em").hide();
            }
            else{
                $(".s-step4>b>b,.s-step4>div,.s-step3>p,.s-step3>b>b,.s-step3>div,.s-step2>p,.s-step2>b>b,.s-step2>div,.s-step1>p,.s-step1>b>b,.s-step1>div,.s-step0>b>b,.s-step0>p,.s-step0>div").addClass("active");
            }
        }
        
        function del_confirm() {
            if(confirm('确实要删除吗?'))
                return true;
            else
                return false;
        }
    </script>
</block>